﻿using System;
using System.Collections.Generic;
using System.Data.Entity.Design.PluralizationServices;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyMainSite2.Library.Extensions
{
	public static class StringExtensions
	{
		#region Public Static Methods

		public static string Pluralize(this string s, int count = 2)
		{
			PluralizationService ps = PluralizationService.CreateService(CultureInfo.CurrentCulture);

			return count > 1 ? ps.Pluralize(s) : s;
		}

		public static string Possessive(this string s)
		{
			s = s.TrimEnd();

			return s.EndsWith("s") ? String.Format("{0}'", s) : String.Format("{0}'s", s);
		}

		#endregion
	}
}
